#pragma once

#include "stdint.h"

#define PI 3.1415926
#define LED_MAGIC 0xcf

enum
{
	LED_COLOR_RGB = 1,
	LED_COLOR_4096
};

enum
{
	LED_TYPE_PIC_SET = 1,
	LED_TYPE_PIC,
	LED_TYPE_LINE
};

enum
{
	LED_STATE_PORTION = 0,
	LED_STATE_RADIUS,
	LED_STATE_COUNT
};

#pragma pack(push, 1)

struct led_head
{
	uint8_t magic;
	uint8_t type;
	uint16_t len;
};

struct pic_head
{
	struct led_head head;
	uint32_t time;
};

struct line_head
{
	struct led_head head;
	uint16_t point;
};

struct file_head
{
	uint16_t radius;
	uint16_t portion;
	uint16_t leaf;
};

#pragma pack(pop)

BOOL GetDialogResourceSize(HINSTANCE hInstance, LPCTSTR lpResName, SIZE *lpSize, WORD wLanguage = 1033);

int toUnicode(LPSTR lpSource, LPWSTR lpTarget, int len );

bool createCdPath(CString &path);

CImage *  CreateStretchImage(CImage *pImage, int StretchHeight, int StretchWidth);

bool  LoadMemImage(void *pMemData, long  len, CImage &image);

